package Chapter08;

import java.util.EnumSet;

/**
 * Created by a on 2017/6/15.
 */
public class Test179 {
    public static void main(String[] args) {
        EnumSet<Week> week = EnumSet.noneOf(Week.class);
        week.add(Week.MONDAY);
        System.out.println("EnumSet中的元素："+week);
        week.remove(Week.MONDAY);
        System.out.println("EnumSet中的元素："+week);
        week.addAll(EnumSet.complementOf(week));
        System.out.println("EnumSet中的元素："+week);
        week.retainAll(EnumSet.range(Week.MONDAY,Week.THURSDAY));
        System.out.println("EnumSet中的元素："+week);
    }

}

enum Week {
    MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURADAY,SUNDAY
}